{% extends "default/base.html" %}
{% load i18n %}
{% load sell_tags %}


{% block content %}
<ul class="breadcrumb">
 <li><a href="{% url market_home %}">{% trans "Home" %}</a><span class="divider">/</span></li>
 <li><a href="{% url market_buy %}">{% trans "Buy" %}</a><span class="divider">/</span></li>
 <li class="active">{% trans "Latest Items" %}</li>
</ul>

<h2>{% trans "Latest Items" %}</h2>
<p>Find the most recently posted items before everyone else does. Don't forget about your <a href="{% url buy_wish_list %}" />wish list.</a></p>



<table class="span12 offset2">
<thead>
<tr>
 <th>Item</th>
 <th>More Items</th>
</tr>
</thead>
<tbody>
{% for product in latest_items %}
 <div id="{{ product.id }}" class="modal hide fade">
            <div class="modal-header">
              <a href="#" class="close">&times;</a>
              <h3>{{ product.title }}</h3>
            </div>
            <div class="modal-body">
              <p><img src="{{product.child.image.image.url_100x100}}" ></p>
             <p>{{ product.description|striptags|safe }}</p>
            <p>
              </div>
            <div class="modal-footer">
              <a href="{% url market_buy_product_redirect product.id %}" target="_blank" class="btn primary">Go To Product Page</a>
              <a href="/">Go Back To Marketplace</a>
            </div>
          </div>
   </div>


<tr> 
<td>

	<div class="item_box latest_items">	
	<a data controls-modal="{{product.id}}" data-backdrop="true" data-keyboard="true">
	{% if product.child.image %}		
	<img class="item" src="{{ product.child.image.image.url_100x100 }}" title="{{ product.description|striptags }}"/>	
	{% else %}			
	<img class="item" src="{{ STATIC_URL }}img/no-photo-medium.jpg" title="{{ product.description|striptags }}"/>	
	{% endif %}			
	<div class="title">{{ product.title|truncatewords:5 }}</div>		
	<div class="dealer">{{ product.shop|truncatewords:2 }}</div>
	{% with product.child.price|money_format2:product.shop as price %}
	<div class="price">{{ product.child.price|money_format:product.shop }}</div>	
	{% endwith %}	
	</a>
	</div>

</td>



	<td>{% trans "More Items from" %} {{ product.shop }}</p>
		{% for other_product in product.shop.last_posted_products %}
			<a href="{% url market_buy_product_redirect other_product.id %}" target="_blank">
			{% if other_product.child.image %}
			<img  src="{{ other_product.child.image.image.url_100x100 }}" width="90px" title="{{ other_product.description|striptags }}"/></img>
			{% else %}
			<img src="{{ STATIC_URL }}img/no-photo-small.jpg" width="90px" title="{{ other_product.description|striptags }}"/></img>
			{% endif %}
			</a>
		{% endfor%}
	</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>

<h4 class="offset2"><a href="{% url market_buy %}" />More Ways to Buy...</a></h2>


</div>

{% endblock %}
